package cn.biplam.front.component.view.systemManage.sysprivi.privilege.menu;

import cn.biplam.common.ajxcode.SystemCode.MenuCode;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.front.component.AjxResponse;
import cn.biplam.front.component.view.systemManage.sysprivi.privilege.menu.manage.MenuMain;
import cn.biplam.front.component.view.systemManage.sysprivi.privilege.menu.manage.MenuPriviMain;
import cn.biplam.front.component.view.systemManage.sysprivi.privilege.menu.manage.add.MenuAdd;
import cn.biplam.front.component.view.systemManage.sysprivi.privilege.menu.manage.del.MenuDel;
import cn.biplam.front.html.base.HtmlWindow;
import cn.biplam.front.template.base.Text;

/**
 * 菜单管理
 * @author XiaoRuxing Dec 8, 20094:04:33 PM
 * @version 1.0
 */
public class MenuManage extends AjxResponse{

	public static final String cId = MenuCode.cId;
	/** 菜单管理主页面 */
	public static final String Main = MenuCode.Main;
	/** 添加菜单界面 */
	public static final String Add_Menu = MenuCode.Add_Menu;
	/**  添加菜单数据提交*/
	public static final String Add_Menu_Submit = MenuCode.Add_Menu_Submit;
	/** 修改菜单 */
	public static final String Edit_Menu = MenuCode.Edit_Menu;
	/** 修改菜单提交 */
	public static final String Edit_Menu_Submit = MenuCode.Edit_Menu_Submit;
	/** 删除菜单 */
	public static final String Del_Menu = MenuCode.Del_Menu;
	/** 删除菜单提交 */
	public static final String Del_Menu_Submit = MenuCode.Del_Menu_Submit;
	/** 菜单信息界面 */
	public static final String Menu_Info = MenuCode.Menu_Info;

	@Override
	protected HtmlWindow ajxGet() throws ErrorMessage {
		if(actionId.equals(Main)){
			return new MenuPriviMain(mUser,sHomeUrl,recordId,params).get();
		}else if(actionId.equals(Add_Menu)){
			return new MenuAdd(mUser,sHomeUrl,recordId,params).get();
		}else if(actionId.equals(Add_Menu_Submit)){
			return new MenuAdd(mUser,sHomeUrl,recordId,params).submit();
		}else if(actionId.equals(Edit_Menu)){
			return new MenuAdd(mUser,sHomeUrl,recordId,params).getEdit();
		}else if(actionId.equals(Edit_Menu_Submit)){
			return new MenuAdd(mUser,sHomeUrl,recordId,params).editSubmit();
		}else if(actionId.equals(Del_Menu)){
			return new MenuDel(mUser,sHomeUrl,recordId,params).get();
		}else if(actionId.equals(Del_Menu_Submit)){
			return new MenuDel(mUser,sHomeUrl,recordId,params).submit();
		}else if(actionId.equals(Menu_Info)){
			return new MenuMain(mUser,sHomeUrl,recordId,params).get();
			
		}else if(actionId.equals(MenuCode.Org_Test)){
			return new Text("测试机构权限").get();

		}else{
			throw new ErrorMessage("Ajx Exchange outport not found:" + actionId	+ " !");
		}
	}
	
}
